package de.sabram.upb.specs.parser.antlr.internal; 

import org.eclipse.xtext.*;
import org.eclipse.xtext.parser.*;
import org.eclipse.xtext.parser.impl.*;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser;
import org.eclipse.xtext.parser.antlr.XtextTokenStream;
import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens;
import org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken;
import de.sabram.upb.specs.services.PtgGrammarAccess;



import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

@SuppressWarnings("all")
public class InternalPtgParser extends AbstractInternalAntlrParser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "RULE_ID", "RULE_STRING", "RULE_INT", "RULE_SL_COMMENT", "RULE_ML_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "':'", "'{'", "'}'", "'['", "']'", "'$'", "'char'", "'double'", "'float'", "'int'", "'long'", "'pointer'", "'short'", "'string'"
    };
    public static final int RULE_ID=4;
    public static final int T__24=24;
    public static final int T__23=23;
    public static final int T__22=22;
    public static final int RULE_ANY_OTHER=10;
    public static final int T__21=21;
    public static final int T__20=20;
    public static final int RULE_SL_COMMENT=7;
    public static final int EOF=-1;
    public static final int RULE_ML_COMMENT=8;
    public static final int T__19=19;
    public static final int RULE_STRING=5;
    public static final int T__16=16;
    public static final int T__15=15;
    public static final int T__18=18;
    public static final int T__17=17;
    public static final int T__12=12;
    public static final int T__11=11;
    public static final int T__14=14;
    public static final int T__13=13;
    public static final int RULE_INT=6;
    public static final int RULE_WS=9;

    // delegates
    // delegators


        public InternalPtgParser(TokenStream input) {
            this(input, new RecognizerSharedState());
        }
        public InternalPtgParser(TokenStream input, RecognizerSharedState state) {
            super(input, state);
             
        }
        

    public String[] getTokenNames() { return InternalPtgParser.tokenNames; }
    public String getGrammarFileName() { return "../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g"; }



     	private PtgGrammarAccess grammarAccess;
     	
        public InternalPtgParser(TokenStream input, PtgGrammarAccess grammarAccess) {
            this(input);
            this.grammarAccess = grammarAccess;
            registerRules(grammarAccess.getGrammar());
        }
        
        @Override
        protected String getFirstRuleName() {
        	return "PTGSpec";	
       	}
       	
       	@Override
       	protected PtgGrammarAccess getGrammarAccess() {
       		return grammarAccess;
       	}



    // $ANTLR start "entryRulePTGSpec"
    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:67:1: entryRulePTGSpec returns [EObject current=null] : iv_rulePTGSpec= rulePTGSpec EOF ;
    public final EObject entryRulePTGSpec() throws RecognitionException {
        EObject current = null;

        EObject iv_rulePTGSpec = null;


        try {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:68:2: (iv_rulePTGSpec= rulePTGSpec EOF )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:69:2: iv_rulePTGSpec= rulePTGSpec EOF
            {
             newCompositeNode(grammarAccess.getPTGSpecRule()); 
            pushFollow(FOLLOW_rulePTGSpec_in_entryRulePTGSpec75);
            iv_rulePTGSpec=rulePTGSpec();

            state._fsp--;

             current =iv_rulePTGSpec; 
            match(input,EOF,FOLLOW_EOF_in_entryRulePTGSpec85); 

            }

        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "entryRulePTGSpec"


    // $ANTLR start "rulePTGSpec"
    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:76:1: rulePTGSpec returns [EObject current=null] : ( (lv_ptgspecs_0_0= rulePatternSpec ) )* ;
    public final EObject rulePTGSpec() throws RecognitionException {
        EObject current = null;

        EObject lv_ptgspecs_0_0 = null;


         enterRule(); 
            
        try {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:79:28: ( ( (lv_ptgspecs_0_0= rulePatternSpec ) )* )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:80:1: ( (lv_ptgspecs_0_0= rulePatternSpec ) )*
            {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:80:1: ( (lv_ptgspecs_0_0= rulePatternSpec ) )*
            loop1:
            do {
                int alt1=2;
                int LA1_0 = input.LA(1);

                if ( (LA1_0==RULE_ID) ) {
                    alt1=1;
                }


                switch (alt1) {
            	case 1 :
            	    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:81:1: (lv_ptgspecs_0_0= rulePatternSpec )
            	    {
            	    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:81:1: (lv_ptgspecs_0_0= rulePatternSpec )
            	    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:82:3: lv_ptgspecs_0_0= rulePatternSpec
            	    {
            	     
            	    	        newCompositeNode(grammarAccess.getPTGSpecAccess().getPtgspecsPatternSpecParserRuleCall_0()); 
            	    	    
            	    pushFollow(FOLLOW_rulePatternSpec_in_rulePTGSpec130);
            	    lv_ptgspecs_0_0=rulePatternSpec();

            	    state._fsp--;


            	    	        if (current==null) {
            	    	            current = createModelElementForParent(grammarAccess.getPTGSpecRule());
            	    	        }
            	           		add(
            	           			current, 
            	           			"ptgspecs",
            	            		lv_ptgspecs_0_0, 
            	            		"PatternSpec");
            	    	        afterParserOrEnumRuleCall();
            	    	    

            	    }


            	    }
            	    break;

            	default :
            	    break loop1;
                }
            } while (true);


            }

             leaveRule(); 
        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "rulePTGSpec"


    // $ANTLR start "entryRulePatternSpec"
    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:106:1: entryRulePatternSpec returns [EObject current=null] : iv_rulePatternSpec= rulePatternSpec EOF ;
    public final EObject entryRulePatternSpec() throws RecognitionException {
        EObject current = null;

        EObject iv_rulePatternSpec = null;


        try {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:107:2: (iv_rulePatternSpec= rulePatternSpec EOF )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:108:2: iv_rulePatternSpec= rulePatternSpec EOF
            {
             newCompositeNode(grammarAccess.getPatternSpecRule()); 
            pushFollow(FOLLOW_rulePatternSpec_in_entryRulePatternSpec166);
            iv_rulePatternSpec=rulePatternSpec();

            state._fsp--;

             current =iv_rulePatternSpec; 
            match(input,EOF,FOLLOW_EOF_in_entryRulePatternSpec176); 

            }

        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "entryRulePatternSpec"


    // $ANTLR start "rulePatternSpec"
    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:115:1: rulePatternSpec returns [EObject current=null] : ( ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' ( (lv_patternBody_2_0= rulePatternBody ) ) ) ;
    public final EObject rulePatternSpec() throws RecognitionException {
        EObject current = null;

        Token lv_name_0_0=null;
        Token otherlv_1=null;
        EObject lv_patternBody_2_0 = null;


         enterRule(); 
            
        try {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:118:28: ( ( ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' ( (lv_patternBody_2_0= rulePatternBody ) ) ) )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:119:1: ( ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' ( (lv_patternBody_2_0= rulePatternBody ) ) )
            {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:119:1: ( ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' ( (lv_patternBody_2_0= rulePatternBody ) ) )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:119:2: ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' ( (lv_patternBody_2_0= rulePatternBody ) )
            {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:119:2: ( (lv_name_0_0= RULE_ID ) )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:120:1: (lv_name_0_0= RULE_ID )
            {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:120:1: (lv_name_0_0= RULE_ID )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:121:3: lv_name_0_0= RULE_ID
            {
            lv_name_0_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_rulePatternSpec218); 

            			newLeafNode(lv_name_0_0, grammarAccess.getPatternSpecAccess().getNameIDTerminalRuleCall_0_0()); 
            		

            	        if (current==null) {
            	            current = createModelElement(grammarAccess.getPatternSpecRule());
            	        }
                   		setWithLastConsumed(
                   			current, 
                   			"name",
                    		lv_name_0_0, 
                    		"ID");
            	    

            }


            }

            otherlv_1=(Token)match(input,11,FOLLOW_11_in_rulePatternSpec235); 

                	newLeafNode(otherlv_1, grammarAccess.getPatternSpecAccess().getColonKeyword_1());
                
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:141:1: ( (lv_patternBody_2_0= rulePatternBody ) )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:142:1: (lv_patternBody_2_0= rulePatternBody )
            {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:142:1: (lv_patternBody_2_0= rulePatternBody )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:143:3: lv_patternBody_2_0= rulePatternBody
            {
             
            	        newCompositeNode(grammarAccess.getPatternSpecAccess().getPatternBodyPatternBodyParserRuleCall_2_0()); 
            	    
            pushFollow(FOLLOW_rulePatternBody_in_rulePatternSpec256);
            lv_patternBody_2_0=rulePatternBody();

            state._fsp--;


            	        if (current==null) {
            	            current = createModelElementForParent(grammarAccess.getPatternSpecRule());
            	        }
                   		set(
                   			current, 
                   			"patternBody",
                    		lv_patternBody_2_0, 
                    		"PatternBody");
            	        afterParserOrEnumRuleCall();
            	    

            }


            }


            }


            }

             leaveRule(); 
        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "rulePatternSpec"


    // $ANTLR start "entryRulePatternBody"
    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:167:1: entryRulePatternBody returns [EObject current=null] : iv_rulePatternBody= rulePatternBody EOF ;
    public final EObject entryRulePatternBody() throws RecognitionException {
        EObject current = null;

        EObject iv_rulePatternBody = null;


        try {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:168:2: (iv_rulePatternBody= rulePatternBody EOF )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:169:2: iv_rulePatternBody= rulePatternBody EOF
            {
             newCompositeNode(grammarAccess.getPatternBodyRule()); 
            pushFollow(FOLLOW_rulePatternBody_in_entryRulePatternBody292);
            iv_rulePatternBody=rulePatternBody();

            state._fsp--;

             current =iv_rulePatternBody; 
            match(input,EOF,FOLLOW_EOF_in_entryRulePatternBody302); 

            }

        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "entryRulePatternBody"


    // $ANTLR start "rulePatternBody"
    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:176:1: rulePatternBody returns [EObject current=null] : ( () ( ( (lv_patternBody_1_1= ruleItem | lv_patternBody_1_2= ruleOptional ) ) )* ) ;
    public final EObject rulePatternBody() throws RecognitionException {
        EObject current = null;

        EObject lv_patternBody_1_1 = null;

        EObject lv_patternBody_1_2 = null;


         enterRule(); 
            
        try {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:179:28: ( ( () ( ( (lv_patternBody_1_1= ruleItem | lv_patternBody_1_2= ruleOptional ) ) )* ) )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:180:1: ( () ( ( (lv_patternBody_1_1= ruleItem | lv_patternBody_1_2= ruleOptional ) ) )* )
            {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:180:1: ( () ( ( (lv_patternBody_1_1= ruleItem | lv_patternBody_1_2= ruleOptional ) ) )* )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:180:2: () ( ( (lv_patternBody_1_1= ruleItem | lv_patternBody_1_2= ruleOptional ) ) )*
            {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:180:2: ()
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:181:5: 
            {

                    current = forceCreateModelElement(
                        grammarAccess.getPatternBodyAccess().getPatternBodyAction_0(),
                        current);
                

            }

            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:186:2: ( ( (lv_patternBody_1_1= ruleItem | lv_patternBody_1_2= ruleOptional ) ) )*
            loop3:
            do {
                int alt3=2;
                int LA3_0 = input.LA(1);

                if ( (LA3_0==RULE_STRING||LA3_0==12||LA3_0==14||LA3_0==16) ) {
                    alt3=1;
                }


                switch (alt3) {
            	case 1 :
            	    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:187:1: ( (lv_patternBody_1_1= ruleItem | lv_patternBody_1_2= ruleOptional ) )
            	    {
            	    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:187:1: ( (lv_patternBody_1_1= ruleItem | lv_patternBody_1_2= ruleOptional ) )
            	    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:188:1: (lv_patternBody_1_1= ruleItem | lv_patternBody_1_2= ruleOptional )
            	    {
            	    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:188:1: (lv_patternBody_1_1= ruleItem | lv_patternBody_1_2= ruleOptional )
            	    int alt2=2;
            	    int LA2_0 = input.LA(1);

            	    if ( (LA2_0==RULE_STRING||LA2_0==14||LA2_0==16) ) {
            	        alt2=1;
            	    }
            	    else if ( (LA2_0==12) ) {
            	        alt2=2;
            	    }
            	    else {
            	        NoViableAltException nvae =
            	            new NoViableAltException("", 2, 0, input);

            	        throw nvae;
            	    }
            	    switch (alt2) {
            	        case 1 :
            	            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:189:3: lv_patternBody_1_1= ruleItem
            	            {
            	             
            	            	        newCompositeNode(grammarAccess.getPatternBodyAccess().getPatternBodyItemParserRuleCall_1_0_0()); 
            	            	    
            	            pushFollow(FOLLOW_ruleItem_in_rulePatternBody359);
            	            lv_patternBody_1_1=ruleItem();

            	            state._fsp--;


            	            	        if (current==null) {
            	            	            current = createModelElementForParent(grammarAccess.getPatternBodyRule());
            	            	        }
            	                   		add(
            	                   			current, 
            	                   			"patternBody",
            	                    		lv_patternBody_1_1, 
            	                    		"Item");
            	            	        afterParserOrEnumRuleCall();
            	            	    

            	            }
            	            break;
            	        case 2 :
            	            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:204:8: lv_patternBody_1_2= ruleOptional
            	            {
            	             
            	            	        newCompositeNode(grammarAccess.getPatternBodyAccess().getPatternBodyOptionalParserRuleCall_1_0_1()); 
            	            	    
            	            pushFollow(FOLLOW_ruleOptional_in_rulePatternBody378);
            	            lv_patternBody_1_2=ruleOptional();

            	            state._fsp--;


            	            	        if (current==null) {
            	            	            current = createModelElementForParent(grammarAccess.getPatternBodyRule());
            	            	        }
            	                   		add(
            	                   			current, 
            	                   			"patternBody",
            	                    		lv_patternBody_1_2, 
            	                    		"Optional");
            	            	        afterParserOrEnumRuleCall();
            	            	    

            	            }
            	            break;

            	    }


            	    }


            	    }
            	    break;

            	default :
            	    break loop3;
                }
            } while (true);


            }


            }

             leaveRule(); 
        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "rulePatternBody"


    // $ANTLR start "entryRuleOptional"
    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:230:1: entryRuleOptional returns [EObject current=null] : iv_ruleOptional= ruleOptional EOF ;
    public final EObject entryRuleOptional() throws RecognitionException {
        EObject current = null;

        EObject iv_ruleOptional = null;


        try {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:231:2: (iv_ruleOptional= ruleOptional EOF )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:232:2: iv_ruleOptional= ruleOptional EOF
            {
             newCompositeNode(grammarAccess.getOptionalRule()); 
            pushFollow(FOLLOW_ruleOptional_in_entryRuleOptional418);
            iv_ruleOptional=ruleOptional();

            state._fsp--;

             current =iv_ruleOptional; 
            match(input,EOF,FOLLOW_EOF_in_entryRuleOptional428); 

            }

        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "entryRuleOptional"


    // $ANTLR start "ruleOptional"
    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:239:1: ruleOptional returns [EObject current=null] : (otherlv_0= '{' ( (lv_items_1_0= ruleItem ) )+ otherlv_2= '}' ) ;
    public final EObject ruleOptional() throws RecognitionException {
        EObject current = null;

        Token otherlv_0=null;
        Token otherlv_2=null;
        EObject lv_items_1_0 = null;


         enterRule(); 
            
        try {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:242:28: ( (otherlv_0= '{' ( (lv_items_1_0= ruleItem ) )+ otherlv_2= '}' ) )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:243:1: (otherlv_0= '{' ( (lv_items_1_0= ruleItem ) )+ otherlv_2= '}' )
            {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:243:1: (otherlv_0= '{' ( (lv_items_1_0= ruleItem ) )+ otherlv_2= '}' )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:243:3: otherlv_0= '{' ( (lv_items_1_0= ruleItem ) )+ otherlv_2= '}'
            {
            otherlv_0=(Token)match(input,12,FOLLOW_12_in_ruleOptional465); 

                	newLeafNode(otherlv_0, grammarAccess.getOptionalAccess().getLeftCurlyBracketKeyword_0());
                
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:247:1: ( (lv_items_1_0= ruleItem ) )+
            int cnt4=0;
            loop4:
            do {
                int alt4=2;
                int LA4_0 = input.LA(1);

                if ( (LA4_0==RULE_STRING||LA4_0==14||LA4_0==16) ) {
                    alt4=1;
                }


                switch (alt4) {
            	case 1 :
            	    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:248:1: (lv_items_1_0= ruleItem )
            	    {
            	    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:248:1: (lv_items_1_0= ruleItem )
            	    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:249:3: lv_items_1_0= ruleItem
            	    {
            	     
            	    	        newCompositeNode(grammarAccess.getOptionalAccess().getItemsItemParserRuleCall_1_0()); 
            	    	    
            	    pushFollow(FOLLOW_ruleItem_in_ruleOptional486);
            	    lv_items_1_0=ruleItem();

            	    state._fsp--;


            	    	        if (current==null) {
            	    	            current = createModelElementForParent(grammarAccess.getOptionalRule());
            	    	        }
            	           		add(
            	           			current, 
            	           			"items",
            	            		lv_items_1_0, 
            	            		"Item");
            	    	        afterParserOrEnumRuleCall();
            	    	    

            	    }


            	    }
            	    break;

            	default :
            	    if ( cnt4 >= 1 ) break loop4;
                        EarlyExitException eee =
                            new EarlyExitException(4, input);
                        throw eee;
                }
                cnt4++;
            } while (true);

            otherlv_2=(Token)match(input,13,FOLLOW_13_in_ruleOptional499); 

                	newLeafNode(otherlv_2, grammarAccess.getOptionalAccess().getRightCurlyBracketKeyword_2());
                

            }


            }

             leaveRule(); 
        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "ruleOptional"


    // $ANTLR start "entryRuleItem"
    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:277:1: entryRuleItem returns [EObject current=null] : iv_ruleItem= ruleItem EOF ;
    public final EObject entryRuleItem() throws RecognitionException {
        EObject current = null;

        EObject iv_ruleItem = null;


        try {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:278:2: (iv_ruleItem= ruleItem EOF )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:279:2: iv_ruleItem= ruleItem EOF
            {
             newCompositeNode(grammarAccess.getItemRule()); 
            pushFollow(FOLLOW_ruleItem_in_entryRuleItem535);
            iv_ruleItem=ruleItem();

            state._fsp--;

             current =iv_ruleItem; 
            match(input,EOF,FOLLOW_EOF_in_entryRuleItem545); 

            }

        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "entryRuleItem"


    // $ANTLR start "ruleItem"
    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:286:1: ruleItem returns [EObject current=null] : ( ( (lv_itemName_0_0= RULE_STRING ) ) | ( (lv_itemCall_1_0= ruleFunctionCall ) ) | ( (lv_insertion_2_0= ruleInsertion ) ) ) ;
    public final EObject ruleItem() throws RecognitionException {
        EObject current = null;

        Token lv_itemName_0_0=null;
        EObject lv_itemCall_1_0 = null;

        EObject lv_insertion_2_0 = null;


         enterRule(); 
            
        try {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:289:28: ( ( ( (lv_itemName_0_0= RULE_STRING ) ) | ( (lv_itemCall_1_0= ruleFunctionCall ) ) | ( (lv_insertion_2_0= ruleInsertion ) ) ) )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:290:1: ( ( (lv_itemName_0_0= RULE_STRING ) ) | ( (lv_itemCall_1_0= ruleFunctionCall ) ) | ( (lv_insertion_2_0= ruleInsertion ) ) )
            {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:290:1: ( ( (lv_itemName_0_0= RULE_STRING ) ) | ( (lv_itemCall_1_0= ruleFunctionCall ) ) | ( (lv_insertion_2_0= ruleInsertion ) ) )
            int alt5=3;
            switch ( input.LA(1) ) {
            case RULE_STRING:
                {
                alt5=1;
                }
                break;
            case 14:
                {
                alt5=2;
                }
                break;
            case 16:
                {
                alt5=3;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 5, 0, input);

                throw nvae;
            }

            switch (alt5) {
                case 1 :
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:290:2: ( (lv_itemName_0_0= RULE_STRING ) )
                    {
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:290:2: ( (lv_itemName_0_0= RULE_STRING ) )
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:291:1: (lv_itemName_0_0= RULE_STRING )
                    {
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:291:1: (lv_itemName_0_0= RULE_STRING )
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:292:3: lv_itemName_0_0= RULE_STRING
                    {
                    lv_itemName_0_0=(Token)match(input,RULE_STRING,FOLLOW_RULE_STRING_in_ruleItem587); 

                    			newLeafNode(lv_itemName_0_0, grammarAccess.getItemAccess().getItemNameSTRINGTerminalRuleCall_0_0()); 
                    		

                    	        if (current==null) {
                    	            current = createModelElement(grammarAccess.getItemRule());
                    	        }
                           		setWithLastConsumed(
                           			current, 
                           			"itemName",
                            		lv_itemName_0_0, 
                            		"STRING");
                    	    

                    }


                    }


                    }
                    break;
                case 2 :
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:309:6: ( (lv_itemCall_1_0= ruleFunctionCall ) )
                    {
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:309:6: ( (lv_itemCall_1_0= ruleFunctionCall ) )
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:310:1: (lv_itemCall_1_0= ruleFunctionCall )
                    {
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:310:1: (lv_itemCall_1_0= ruleFunctionCall )
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:311:3: lv_itemCall_1_0= ruleFunctionCall
                    {
                     
                    	        newCompositeNode(grammarAccess.getItemAccess().getItemCallFunctionCallParserRuleCall_1_0()); 
                    	    
                    pushFollow(FOLLOW_ruleFunctionCall_in_ruleItem619);
                    lv_itemCall_1_0=ruleFunctionCall();

                    state._fsp--;


                    	        if (current==null) {
                    	            current = createModelElementForParent(grammarAccess.getItemRule());
                    	        }
                           		set(
                           			current, 
                           			"itemCall",
                            		lv_itemCall_1_0, 
                            		"FunctionCall");
                    	        afterParserOrEnumRuleCall();
                    	    

                    }


                    }


                    }
                    break;
                case 3 :
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:328:6: ( (lv_insertion_2_0= ruleInsertion ) )
                    {
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:328:6: ( (lv_insertion_2_0= ruleInsertion ) )
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:329:1: (lv_insertion_2_0= ruleInsertion )
                    {
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:329:1: (lv_insertion_2_0= ruleInsertion )
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:330:3: lv_insertion_2_0= ruleInsertion
                    {
                     
                    	        newCompositeNode(grammarAccess.getItemAccess().getInsertionInsertionParserRuleCall_2_0()); 
                    	    
                    pushFollow(FOLLOW_ruleInsertion_in_ruleItem646);
                    lv_insertion_2_0=ruleInsertion();

                    state._fsp--;


                    	        if (current==null) {
                    	            current = createModelElementForParent(grammarAccess.getItemRule());
                    	        }
                           		set(
                           			current, 
                           			"insertion",
                            		lv_insertion_2_0, 
                            		"Insertion");
                    	        afterParserOrEnumRuleCall();
                    	    

                    }


                    }


                    }
                    break;

            }


            }

             leaveRule(); 
        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "ruleItem"


    // $ANTLR start "entryRuleFunctionCall"
    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:354:1: entryRuleFunctionCall returns [EObject current=null] : iv_ruleFunctionCall= ruleFunctionCall EOF ;
    public final EObject entryRuleFunctionCall() throws RecognitionException {
        EObject current = null;

        EObject iv_ruleFunctionCall = null;


        try {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:355:2: (iv_ruleFunctionCall= ruleFunctionCall EOF )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:356:2: iv_ruleFunctionCall= ruleFunctionCall EOF
            {
             newCompositeNode(grammarAccess.getFunctionCallRule()); 
            pushFollow(FOLLOW_ruleFunctionCall_in_entryRuleFunctionCall682);
            iv_ruleFunctionCall=ruleFunctionCall();

            state._fsp--;

             current =iv_ruleFunctionCall; 
            match(input,EOF,FOLLOW_EOF_in_entryRuleFunctionCall692); 

            }

        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "entryRuleFunctionCall"


    // $ANTLR start "ruleFunctionCall"
    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:363:1: ruleFunctionCall returns [EObject current=null] : (otherlv_0= '[' ( (lv_name_1_0= RULE_ID ) ) ( (lv_arguments_2_0= ruleArgument ) )* otherlv_3= ']' ) ;
    public final EObject ruleFunctionCall() throws RecognitionException {
        EObject current = null;

        Token otherlv_0=null;
        Token lv_name_1_0=null;
        Token otherlv_3=null;
        EObject lv_arguments_2_0 = null;


         enterRule(); 
            
        try {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:366:28: ( (otherlv_0= '[' ( (lv_name_1_0= RULE_ID ) ) ( (lv_arguments_2_0= ruleArgument ) )* otherlv_3= ']' ) )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:367:1: (otherlv_0= '[' ( (lv_name_1_0= RULE_ID ) ) ( (lv_arguments_2_0= ruleArgument ) )* otherlv_3= ']' )
            {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:367:1: (otherlv_0= '[' ( (lv_name_1_0= RULE_ID ) ) ( (lv_arguments_2_0= ruleArgument ) )* otherlv_3= ']' )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:367:3: otherlv_0= '[' ( (lv_name_1_0= RULE_ID ) ) ( (lv_arguments_2_0= ruleArgument ) )* otherlv_3= ']'
            {
            otherlv_0=(Token)match(input,14,FOLLOW_14_in_ruleFunctionCall729); 

                	newLeafNode(otherlv_0, grammarAccess.getFunctionCallAccess().getLeftSquareBracketKeyword_0());
                
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:371:1: ( (lv_name_1_0= RULE_ID ) )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:372:1: (lv_name_1_0= RULE_ID )
            {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:372:1: (lv_name_1_0= RULE_ID )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:373:3: lv_name_1_0= RULE_ID
            {
            lv_name_1_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleFunctionCall746); 

            			newLeafNode(lv_name_1_0, grammarAccess.getFunctionCallAccess().getNameIDTerminalRuleCall_1_0()); 
            		

            	        if (current==null) {
            	            current = createModelElement(grammarAccess.getFunctionCallRule());
            	        }
                   		setWithLastConsumed(
                   			current, 
                   			"name",
                    		lv_name_1_0, 
                    		"ID");
            	    

            }


            }

            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:389:2: ( (lv_arguments_2_0= ruleArgument ) )*
            loop6:
            do {
                int alt6=2;
                int LA6_0 = input.LA(1);

                if ( (LA6_0==16) ) {
                    alt6=1;
                }


                switch (alt6) {
            	case 1 :
            	    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:390:1: (lv_arguments_2_0= ruleArgument )
            	    {
            	    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:390:1: (lv_arguments_2_0= ruleArgument )
            	    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:391:3: lv_arguments_2_0= ruleArgument
            	    {
            	     
            	    	        newCompositeNode(grammarAccess.getFunctionCallAccess().getArgumentsArgumentParserRuleCall_2_0()); 
            	    	    
            	    pushFollow(FOLLOW_ruleArgument_in_ruleFunctionCall772);
            	    lv_arguments_2_0=ruleArgument();

            	    state._fsp--;


            	    	        if (current==null) {
            	    	            current = createModelElementForParent(grammarAccess.getFunctionCallRule());
            	    	        }
            	           		add(
            	           			current, 
            	           			"arguments",
            	            		lv_arguments_2_0, 
            	            		"Argument");
            	    	        afterParserOrEnumRuleCall();
            	    	    

            	    }


            	    }
            	    break;

            	default :
            	    break loop6;
                }
            } while (true);

            otherlv_3=(Token)match(input,15,FOLLOW_15_in_ruleFunctionCall785); 

                	newLeafNode(otherlv_3, grammarAccess.getFunctionCallAccess().getRightSquareBracketKeyword_3());
                

            }


            }

             leaveRule(); 
        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "ruleFunctionCall"


    // $ANTLR start "entryRuleArgument"
    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:419:1: entryRuleArgument returns [EObject current=null] : iv_ruleArgument= ruleArgument EOF ;
    public final EObject entryRuleArgument() throws RecognitionException {
        EObject current = null;

        EObject iv_ruleArgument = null;


        try {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:420:2: (iv_ruleArgument= ruleArgument EOF )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:421:2: iv_ruleArgument= ruleArgument EOF
            {
             newCompositeNode(grammarAccess.getArgumentRule()); 
            pushFollow(FOLLOW_ruleArgument_in_entryRuleArgument821);
            iv_ruleArgument=ruleArgument();

            state._fsp--;

             current =iv_ruleArgument; 
            match(input,EOF,FOLLOW_EOF_in_entryRuleArgument831); 

            }

        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "entryRuleArgument"


    // $ANTLR start "ruleArgument"
    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:428:1: ruleArgument returns [EObject current=null] : ( (lv_insertion_0_0= ruleInsertion ) ) ;
    public final EObject ruleArgument() throws RecognitionException {
        EObject current = null;

        EObject lv_insertion_0_0 = null;


         enterRule(); 
            
        try {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:431:28: ( ( (lv_insertion_0_0= ruleInsertion ) ) )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:432:1: ( (lv_insertion_0_0= ruleInsertion ) )
            {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:432:1: ( (lv_insertion_0_0= ruleInsertion ) )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:433:1: (lv_insertion_0_0= ruleInsertion )
            {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:433:1: (lv_insertion_0_0= ruleInsertion )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:434:3: lv_insertion_0_0= ruleInsertion
            {
             
            	        newCompositeNode(grammarAccess.getArgumentAccess().getInsertionInsertionParserRuleCall_0()); 
            	    
            pushFollow(FOLLOW_ruleInsertion_in_ruleArgument876);
            lv_insertion_0_0=ruleInsertion();

            state._fsp--;


            	        if (current==null) {
            	            current = createModelElementForParent(grammarAccess.getArgumentRule());
            	        }
                   		set(
                   			current, 
                   			"insertion",
                    		lv_insertion_0_0, 
                    		"Insertion");
            	        afterParserOrEnumRuleCall();
            	    

            }


            }


            }

             leaveRule(); 
        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "ruleArgument"


    // $ANTLR start "entryRuleInsertion"
    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:458:1: entryRuleInsertion returns [EObject current=null] : iv_ruleInsertion= ruleInsertion EOF ;
    public final EObject entryRuleInsertion() throws RecognitionException {
        EObject current = null;

        EObject iv_ruleInsertion = null;


        try {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:459:2: (iv_ruleInsertion= ruleInsertion EOF )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:460:2: iv_ruleInsertion= ruleInsertion EOF
            {
             newCompositeNode(grammarAccess.getInsertionRule()); 
            pushFollow(FOLLOW_ruleInsertion_in_entryRuleInsertion911);
            iv_ruleInsertion=ruleInsertion();

            state._fsp--;

             current =iv_ruleInsertion; 
            match(input,EOF,FOLLOW_EOF_in_entryRuleInsertion921); 

            }

        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "entryRuleInsertion"


    // $ANTLR start "ruleInsertion"
    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:467:1: ruleInsertion returns [EObject current=null] : ( () otherlv_1= '$' ( (lv_index_2_0= RULE_INT ) )? ( (lv_type_3_0= ruleType ) )? ) ;
    public final EObject ruleInsertion() throws RecognitionException {
        EObject current = null;

        Token otherlv_1=null;
        Token lv_index_2_0=null;
        EObject lv_type_3_0 = null;


         enterRule(); 
            
        try {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:470:28: ( ( () otherlv_1= '$' ( (lv_index_2_0= RULE_INT ) )? ( (lv_type_3_0= ruleType ) )? ) )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:471:1: ( () otherlv_1= '$' ( (lv_index_2_0= RULE_INT ) )? ( (lv_type_3_0= ruleType ) )? )
            {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:471:1: ( () otherlv_1= '$' ( (lv_index_2_0= RULE_INT ) )? ( (lv_type_3_0= ruleType ) )? )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:471:2: () otherlv_1= '$' ( (lv_index_2_0= RULE_INT ) )? ( (lv_type_3_0= ruleType ) )?
            {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:471:2: ()
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:472:5: 
            {

                    current = forceCreateModelElement(
                        grammarAccess.getInsertionAccess().getInsertionAction_0(),
                        current);
                

            }

            otherlv_1=(Token)match(input,16,FOLLOW_16_in_ruleInsertion967); 

                	newLeafNode(otherlv_1, grammarAccess.getInsertionAccess().getDollarSignKeyword_1());
                
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:481:1: ( (lv_index_2_0= RULE_INT ) )?
            int alt7=2;
            int LA7_0 = input.LA(1);

            if ( (LA7_0==RULE_INT) ) {
                alt7=1;
            }
            switch (alt7) {
                case 1 :
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:482:1: (lv_index_2_0= RULE_INT )
                    {
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:482:1: (lv_index_2_0= RULE_INT )
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:483:3: lv_index_2_0= RULE_INT
                    {
                    lv_index_2_0=(Token)match(input,RULE_INT,FOLLOW_RULE_INT_in_ruleInsertion984); 

                    			newLeafNode(lv_index_2_0, grammarAccess.getInsertionAccess().getIndexINTTerminalRuleCall_2_0()); 
                    		

                    	        if (current==null) {
                    	            current = createModelElement(grammarAccess.getInsertionRule());
                    	        }
                           		setWithLastConsumed(
                           			current, 
                           			"index",
                            		lv_index_2_0, 
                            		"INT");
                    	    

                    }


                    }
                    break;

            }

            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:499:3: ( (lv_type_3_0= ruleType ) )?
            int alt8=2;
            int LA8_0 = input.LA(1);

            if ( ((LA8_0>=17 && LA8_0<=24)) ) {
                alt8=1;
            }
            switch (alt8) {
                case 1 :
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:500:1: (lv_type_3_0= ruleType )
                    {
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:500:1: (lv_type_3_0= ruleType )
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:501:3: lv_type_3_0= ruleType
                    {
                     
                    	        newCompositeNode(grammarAccess.getInsertionAccess().getTypeTypeParserRuleCall_3_0()); 
                    	    
                    pushFollow(FOLLOW_ruleType_in_ruleInsertion1011);
                    lv_type_3_0=ruleType();

                    state._fsp--;


                    	        if (current==null) {
                    	            current = createModelElementForParent(grammarAccess.getInsertionRule());
                    	        }
                           		set(
                           			current, 
                           			"type",
                            		lv_type_3_0, 
                            		"Type");
                    	        afterParserOrEnumRuleCall();
                    	    

                    }


                    }
                    break;

            }


            }


            }

             leaveRule(); 
        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "ruleInsertion"


    // $ANTLR start "entryRuleType"
    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:525:1: entryRuleType returns [EObject current=null] : iv_ruleType= ruleType EOF ;
    public final EObject entryRuleType() throws RecognitionException {
        EObject current = null;

        EObject iv_ruleType = null;


        try {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:526:2: (iv_ruleType= ruleType EOF )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:527:2: iv_ruleType= ruleType EOF
            {
             newCompositeNode(grammarAccess.getTypeRule()); 
            pushFollow(FOLLOW_ruleType_in_entryRuleType1048);
            iv_ruleType=ruleType();

            state._fsp--;

             current =iv_ruleType; 
            match(input,EOF,FOLLOW_EOF_in_entryRuleType1058); 

            }

        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "entryRuleType"


    // $ANTLR start "ruleType"
    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:534:1: ruleType returns [EObject current=null] : ( ( (lv_name_0_1= 'char' | lv_name_0_2= 'double' | lv_name_0_3= 'float' | lv_name_0_4= 'int' | lv_name_0_5= 'long' | lv_name_0_6= 'pointer' | lv_name_0_7= 'short' | lv_name_0_8= 'string' ) ) ) ;
    public final EObject ruleType() throws RecognitionException {
        EObject current = null;

        Token lv_name_0_1=null;
        Token lv_name_0_2=null;
        Token lv_name_0_3=null;
        Token lv_name_0_4=null;
        Token lv_name_0_5=null;
        Token lv_name_0_6=null;
        Token lv_name_0_7=null;
        Token lv_name_0_8=null;

         enterRule(); 
            
        try {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:537:28: ( ( ( (lv_name_0_1= 'char' | lv_name_0_2= 'double' | lv_name_0_3= 'float' | lv_name_0_4= 'int' | lv_name_0_5= 'long' | lv_name_0_6= 'pointer' | lv_name_0_7= 'short' | lv_name_0_8= 'string' ) ) ) )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:538:1: ( ( (lv_name_0_1= 'char' | lv_name_0_2= 'double' | lv_name_0_3= 'float' | lv_name_0_4= 'int' | lv_name_0_5= 'long' | lv_name_0_6= 'pointer' | lv_name_0_7= 'short' | lv_name_0_8= 'string' ) ) )
            {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:538:1: ( ( (lv_name_0_1= 'char' | lv_name_0_2= 'double' | lv_name_0_3= 'float' | lv_name_0_4= 'int' | lv_name_0_5= 'long' | lv_name_0_6= 'pointer' | lv_name_0_7= 'short' | lv_name_0_8= 'string' ) ) )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:539:1: ( (lv_name_0_1= 'char' | lv_name_0_2= 'double' | lv_name_0_3= 'float' | lv_name_0_4= 'int' | lv_name_0_5= 'long' | lv_name_0_6= 'pointer' | lv_name_0_7= 'short' | lv_name_0_8= 'string' ) )
            {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:539:1: ( (lv_name_0_1= 'char' | lv_name_0_2= 'double' | lv_name_0_3= 'float' | lv_name_0_4= 'int' | lv_name_0_5= 'long' | lv_name_0_6= 'pointer' | lv_name_0_7= 'short' | lv_name_0_8= 'string' ) )
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:540:1: (lv_name_0_1= 'char' | lv_name_0_2= 'double' | lv_name_0_3= 'float' | lv_name_0_4= 'int' | lv_name_0_5= 'long' | lv_name_0_6= 'pointer' | lv_name_0_7= 'short' | lv_name_0_8= 'string' )
            {
            // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:540:1: (lv_name_0_1= 'char' | lv_name_0_2= 'double' | lv_name_0_3= 'float' | lv_name_0_4= 'int' | lv_name_0_5= 'long' | lv_name_0_6= 'pointer' | lv_name_0_7= 'short' | lv_name_0_8= 'string' )
            int alt9=8;
            switch ( input.LA(1) ) {
            case 17:
                {
                alt9=1;
                }
                break;
            case 18:
                {
                alt9=2;
                }
                break;
            case 19:
                {
                alt9=3;
                }
                break;
            case 20:
                {
                alt9=4;
                }
                break;
            case 21:
                {
                alt9=5;
                }
                break;
            case 22:
                {
                alt9=6;
                }
                break;
            case 23:
                {
                alt9=7;
                }
                break;
            case 24:
                {
                alt9=8;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 9, 0, input);

                throw nvae;
            }

            switch (alt9) {
                case 1 :
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:541:3: lv_name_0_1= 'char'
                    {
                    lv_name_0_1=(Token)match(input,17,FOLLOW_17_in_ruleType1102); 

                            newLeafNode(lv_name_0_1, grammarAccess.getTypeAccess().getNameCharKeyword_0_0());
                        

                    	        if (current==null) {
                    	            current = createModelElement(grammarAccess.getTypeRule());
                    	        }
                           		setWithLastConsumed(current, "name", lv_name_0_1, null);
                    	    

                    }
                    break;
                case 2 :
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:553:8: lv_name_0_2= 'double'
                    {
                    lv_name_0_2=(Token)match(input,18,FOLLOW_18_in_ruleType1131); 

                            newLeafNode(lv_name_0_2, grammarAccess.getTypeAccess().getNameDoubleKeyword_0_1());
                        

                    	        if (current==null) {
                    	            current = createModelElement(grammarAccess.getTypeRule());
                    	        }
                           		setWithLastConsumed(current, "name", lv_name_0_2, null);
                    	    

                    }
                    break;
                case 3 :
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:565:8: lv_name_0_3= 'float'
                    {
                    lv_name_0_3=(Token)match(input,19,FOLLOW_19_in_ruleType1160); 

                            newLeafNode(lv_name_0_3, grammarAccess.getTypeAccess().getNameFloatKeyword_0_2());
                        

                    	        if (current==null) {
                    	            current = createModelElement(grammarAccess.getTypeRule());
                    	        }
                           		setWithLastConsumed(current, "name", lv_name_0_3, null);
                    	    

                    }
                    break;
                case 4 :
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:577:8: lv_name_0_4= 'int'
                    {
                    lv_name_0_4=(Token)match(input,20,FOLLOW_20_in_ruleType1189); 

                            newLeafNode(lv_name_0_4, grammarAccess.getTypeAccess().getNameIntKeyword_0_3());
                        

                    	        if (current==null) {
                    	            current = createModelElement(grammarAccess.getTypeRule());
                    	        }
                           		setWithLastConsumed(current, "name", lv_name_0_4, null);
                    	    

                    }
                    break;
                case 5 :
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:589:8: lv_name_0_5= 'long'
                    {
                    lv_name_0_5=(Token)match(input,21,FOLLOW_21_in_ruleType1218); 

                            newLeafNode(lv_name_0_5, grammarAccess.getTypeAccess().getNameLongKeyword_0_4());
                        

                    	        if (current==null) {
                    	            current = createModelElement(grammarAccess.getTypeRule());
                    	        }
                           		setWithLastConsumed(current, "name", lv_name_0_5, null);
                    	    

                    }
                    break;
                case 6 :
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:601:8: lv_name_0_6= 'pointer'
                    {
                    lv_name_0_6=(Token)match(input,22,FOLLOW_22_in_ruleType1247); 

                            newLeafNode(lv_name_0_6, grammarAccess.getTypeAccess().getNamePointerKeyword_0_5());
                        

                    	        if (current==null) {
                    	            current = createModelElement(grammarAccess.getTypeRule());
                    	        }
                           		setWithLastConsumed(current, "name", lv_name_0_6, null);
                    	    

                    }
                    break;
                case 7 :
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:613:8: lv_name_0_7= 'short'
                    {
                    lv_name_0_7=(Token)match(input,23,FOLLOW_23_in_ruleType1276); 

                            newLeafNode(lv_name_0_7, grammarAccess.getTypeAccess().getNameShortKeyword_0_6());
                        

                    	        if (current==null) {
                    	            current = createModelElement(grammarAccess.getTypeRule());
                    	        }
                           		setWithLastConsumed(current, "name", lv_name_0_7, null);
                    	    

                    }
                    break;
                case 8 :
                    // ../de.sabram.upb.specs.ptg/src-gen/de/sabram/upb/specs/parser/antlr/internal/InternalPtg.g:625:8: lv_name_0_8= 'string'
                    {
                    lv_name_0_8=(Token)match(input,24,FOLLOW_24_in_ruleType1305); 

                            newLeafNode(lv_name_0_8, grammarAccess.getTypeAccess().getNameStringKeyword_0_7());
                        

                    	        if (current==null) {
                    	            current = createModelElement(grammarAccess.getTypeRule());
                    	        }
                           		setWithLastConsumed(current, "name", lv_name_0_8, null);
                    	    

                    }
                    break;

            }


            }


            }


            }

             leaveRule(); 
        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "ruleType"

    // Delegated rules


 

    public static final BitSet FOLLOW_rulePTGSpec_in_entryRulePTGSpec75 = new BitSet(new long[]{0x0000000000000000L});
    public static final BitSet FOLLOW_EOF_in_entryRulePTGSpec85 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_rulePatternSpec_in_rulePTGSpec130 = new BitSet(new long[]{0x0000000000000012L});
    public static final BitSet FOLLOW_rulePatternSpec_in_entryRulePatternSpec166 = new BitSet(new long[]{0x0000000000000000L});
    public static final BitSet FOLLOW_EOF_in_entryRulePatternSpec176 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_RULE_ID_in_rulePatternSpec218 = new BitSet(new long[]{0x0000000000000800L});
    public static final BitSet FOLLOW_11_in_rulePatternSpec235 = new BitSet(new long[]{0x0000000000015020L});
    public static final BitSet FOLLOW_rulePatternBody_in_rulePatternSpec256 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_rulePatternBody_in_entryRulePatternBody292 = new BitSet(new long[]{0x0000000000000000L});
    public static final BitSet FOLLOW_EOF_in_entryRulePatternBody302 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ruleItem_in_rulePatternBody359 = new BitSet(new long[]{0x0000000000015022L});
    public static final BitSet FOLLOW_ruleOptional_in_rulePatternBody378 = new BitSet(new long[]{0x0000000000015022L});
    public static final BitSet FOLLOW_ruleOptional_in_entryRuleOptional418 = new BitSet(new long[]{0x0000000000000000L});
    public static final BitSet FOLLOW_EOF_in_entryRuleOptional428 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_12_in_ruleOptional465 = new BitSet(new long[]{0x0000000000014020L});
    public static final BitSet FOLLOW_ruleItem_in_ruleOptional486 = new BitSet(new long[]{0x0000000000016020L});
    public static final BitSet FOLLOW_13_in_ruleOptional499 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ruleItem_in_entryRuleItem535 = new BitSet(new long[]{0x0000000000000000L});
    public static final BitSet FOLLOW_EOF_in_entryRuleItem545 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_RULE_STRING_in_ruleItem587 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ruleFunctionCall_in_ruleItem619 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ruleInsertion_in_ruleItem646 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ruleFunctionCall_in_entryRuleFunctionCall682 = new BitSet(new long[]{0x0000000000000000L});
    public static final BitSet FOLLOW_EOF_in_entryRuleFunctionCall692 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_14_in_ruleFunctionCall729 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_RULE_ID_in_ruleFunctionCall746 = new BitSet(new long[]{0x000000000001C020L});
    public static final BitSet FOLLOW_ruleArgument_in_ruleFunctionCall772 = new BitSet(new long[]{0x000000000001C020L});
    public static final BitSet FOLLOW_15_in_ruleFunctionCall785 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ruleArgument_in_entryRuleArgument821 = new BitSet(new long[]{0x0000000000000000L});
    public static final BitSet FOLLOW_EOF_in_entryRuleArgument831 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ruleInsertion_in_ruleArgument876 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ruleInsertion_in_entryRuleInsertion911 = new BitSet(new long[]{0x0000000000000000L});
    public static final BitSet FOLLOW_EOF_in_entryRuleInsertion921 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_16_in_ruleInsertion967 = new BitSet(new long[]{0x0000000001FE0042L});
    public static final BitSet FOLLOW_RULE_INT_in_ruleInsertion984 = new BitSet(new long[]{0x0000000001FE0002L});
    public static final BitSet FOLLOW_ruleType_in_ruleInsertion1011 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ruleType_in_entryRuleType1048 = new BitSet(new long[]{0x0000000000000000L});
    public static final BitSet FOLLOW_EOF_in_entryRuleType1058 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_17_in_ruleType1102 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_18_in_ruleType1131 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_19_in_ruleType1160 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_20_in_ruleType1189 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_21_in_ruleType1218 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_22_in_ruleType1247 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_23_in_ruleType1276 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_24_in_ruleType1305 = new BitSet(new long[]{0x0000000000000002L});

}